<?php

// +----------------------------------------------------------------------
// | TwoThink [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.twothink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

class Config
{

    /**
     * 获取数据库中的配置列表
     * @return array 配置数组
     */
    public static function lists($cache = true)
    {
        $key = $cache ? "all_config" : false;
        return cache_read_and_write($key, 'common/config/lists', ['config'], 'config');
    }
    
    /**
     * 清理缓存
     */
    public static function clearCache()
    {
        think\Cache::clear('config');
        self::lists();
    }

}
